package com.yuexun.dhdoctor.module.departmentDocumentNew.model.impl;



import com.yuexun.dhdoctor.base.BaseEntity;
import com.yuexun.dhdoctor.module.departmentDocumentNew.api.UserDepartDocTreeApi;
import com.yuexun.dhdoctor.module.departmentDocumentNew.bean.DocDepartBean;
import com.yuexun.dhdoctor.module.departmentDocumentNew.model.IUserDepartDocTreeModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by wangt on 2017/7/14.
 */

public class UserDepartDocTreeModel implements IUserDepartDocTreeModel {
    private UserDepartDocTreeApi api;

    public UserDepartDocTreeApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(UserDepartDocTreeApi.class);
        }
    }

    @Override
    public Observable<BaseEntity<DocDepartBean>> getDepartTree(Map<String, String> praise) {
        api = ApiInstance();
        return api.getDepartTree(praise);
    }
}
